# /bin/zsh

# 系统配置相关

echo “检测并更换国内源中...”
echo “请在弹出的窗口中选择适合的源（PS：清华源已经不再支持AUR,请勿使用清华源）”
sudo pacman-mirrors -i -c China -m rank


echo "更改时间设置,解决8小时时差..."
sudo timedatectl set-local-rtc 1


echo "安装yay..."
sudo pacman -S yay


# 网络配置相关
echo "安装ShellClash..."
export url='https://gh.jwsc.eu.org/master' && sh -c "$(curl -kfsSl $url/install.sh)" && source /etc/profile &> /dev/null


echo "安装Clash for Windows(Linux)..."
yay -S clash-for-windows-chinese


# 系统工具配置
echo "安装fcitx5以支持中文输入..."
yay -S manjaro-asian-input-support-fcitx5


echo "创建目录，下载主题..."
mkdir -p ~/.local/share/fcitx5/themes/fcitx5-dark-transparent
git clone https://github.com/hosxy/fcitx5-dark-transparent.git ~/.local/share/fcitx5/themes/fcitx5-dark-transparent
cp ./config/fcitx5/classicui.config ~/.config/fcitx5/conf/
read -s -n1 -p "请重启输入法后按任意键继续配置..."


# 开发工具配置
echo "Git配置:"
read -p "请输入Git用户名:" username
read -p "请输入Git邮箱:" email
read -p "请输入代理服务器IP及端口号(eg. 127.0.0.1:7890)" proxyserver
git config --global user.name "$username"
git config --global user.email "$email"
git config --global https.proxy $proxyserver


echo "安装VScode..."
yay -S visual-studio-code-bin


# 日常软件
echo “安装QQ...”
yay -S linuxqq


echo “安装google-chrome...”
yay -S google-chrome
echo “为google-chrome配置代理...”
echo --proxy-server="$proxyserver" >  ~/.config/chrome-flags.conf


echo "安装网易云音乐..."
yay -S netease-cloud-music